package com.hqyj.service.impl;

import com.github.pagehelper.PageHelper;
import com.hqyj.dao.PermissionMapper;
import com.hqyj.pojo.Permission;
import com.hqyj.service.PermissionService;
import jdk.internal.org.objectweb.asm.TypeReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Service
public class PermissionServiceImpl implements PermissionService {
    @Autowired
    PermissionMapper permissionMapper;


    public HashMap<String, Object> permissionList() {
        HashMap<String, Object> map = new HashMap<String, Object>();
        try {
            List<Permission> permissionList = permissionMapper.selectList();
            if (permissionList == null || permissionList.size() < 1) {
                map.put("info", "当前没有权限数据！");
            } else {

                map.put("info", permissionList);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

        return map;
    }
}
